{if $nb_annonce == 0}

{else}

<script type="text/javascript">
<!--
	function delannonce(id)
	{
    	if (confirm('{$lang.Confirmation_suppression_annonce} ?'))
	    {
	           document.location.href = 'annonce.php?delete&token={$token}&annonce_id='+id;
        }
	}
// -->
</script>

<div style="float:right;">
	<a href="annonce_ajout.php" title="" />
		<img src="images/annonce_add.png" style="border:none; height:20px; width:20px;" />
	</a>
</div>

<h3>{$lang.Annonces}</h3><br /><br />

{if $error_msg == true}
<span id="errorh"></span>
<div id="error_msg">
	<div class="{$error_class}" style="width:500px;margin:auto;padding:15px;">
		<img src="{$url_site}images/{$error_image}.png" alt="" style="float:left;padding-right:6px;" /> {$error_message}
	</div>
	<br />
</div>
<script type="text/javascript">
<!--
	//Javascript timeout to hide this message
	setTimeout('Effect.Fade("error_msg");', 3000);
-->
</script>
<br /><br />
{/if}
{* Formulaire de rechercher par reference *}
<div class="center"><form method="GET" action="annonce.php"><label>{$lang.Reference} : </label><input type="text" name="reference" />&nbsp;<input type="submit" value="{$lang.Recherche}" /></form></div>
<br /><br />
{* pagination haut *}
<div style="width:98%; margin:auto;">{$pagination}</div>
{* En tete tableau *}
<table style="width:98%; margin:auto;" cellpadding="1" cellspacing="1">
	<tr>
		<td class="thead"><a href="annonce.php">#</strong></td>
		<td class="thead"><a href="annonce.php?order=titre" title=""><strong>{$lang.Titre}</strong></a></td>
		<td class="thead"><a href="annonce.php?order=ref" title=""><strong>{$lang.Reference}</strong></a></td>
		<td class="thead"><a href="annonce.php?order=type"><strong>{$lang.Type}</strong></a></td>
		<td class="thead"><a href="annonce.php?order=agence"><strong>{$lang.Agence}</strong></a></td>
		<td class="thead"><a href="annonce.php?order=date_ajout" title=""><strong>{$lang.Ajoute_le}</strong></a></td>
        <td class="thead"><a href="annonce.php?order=nb_vue" title=""><strong>{$lang.Vue}</strong></a></td>
		<td class="thead"><strong>{$lang.Action}</strong></td>
	</tr>
    
	{section name=ida loop=$annonces}
	<tr>
		<td class="tcontenue">{$annonces[ida].id}</td>
		<td class="tcontenue">{$annonces[ida].titre}</td>
		<td class="tcontenue">{$annonces[ida].ref}</td>
		<td class="tcontenue">{$annonces[ida].type_text}</td>
		<td class="tcontenue">{$annonces[ida].agence_nom}</td>
		<td class="tcontenue">{$annonces[ida].date_ajout}</td>
        <td class="tcontenue">{$annonces[ida].nb_vue}</strong></td>
		<td class="tcontenue">{$annonces[ida].action}</td>
	</tr>
    {/section}
    
    {* pagination bas de page *}
	<tr><td colspan="7">{$pagination}</td></tr>
</table>

{* Affichage des annonces vendu et encore active *}
{if $nb_aav > 0}
<hr />
<h3>{$lang.Annonce_active_vendu}</h3>
<br />
<br />
<table style="width:98%; margin:auto;" cellpadding="1" cellspacing="1">
	<tr>
		<td class="thead">#</strong></td>
		<td class="thead"><strong>{$lang.Titre}</strong></td>
		<td class="thead"><strong>{$lang.Reference}</strong></td>
		<td class="thead"><strong>{$lang.Type}</strong></td>
		<td class="thead"><strong>{$lang.Agence}</strong></td>
		<td class="thead"><strong>{$lang.Ajoute_le}</strong></td>
        <td class="thead"><strong>{$lang.Vue}</strong></td>
		<td class="thead"><strong>{$lang.Action}</strong></td>
	</tr>
	
    {section name=ida2 loop=$annonces2}
	<tr>
		<td class="tcontenue">{$annonces2[ida2].id}</td>
		<td class="tcontenue">{$annonces2[ida2].titre}</td>
		<td class="tcontenue">{$annonces2[ida2].ref}</td>
		<td class="tcontenue">{$annonces2[ida2].type_text}</td>
		<td class="tcontenue">{$annonces2[ida2].agence_nom}</td>
		<td class="tcontenue">{$annonces2[ida2].date_ajout}</td>
        <td class="tcontenue">{$annonces2[ida2].nb_vue}</strong></td>
		<td class="tcontenue">{$annonces2[ida2].action}</td>
	</tr>
    {/section}
    
</table>
{/if}
<br />
<br />
{/if}
{* fermeture du si annonce > 0 *}